<?php

class Item_Model extends Model {

    public function __construct() {
        parent::__construct();
    }
    
    public function get() {
        $arr = $this -> db -> select('SELECT * FROM item');
        return json_encode($arr);
    }
    
    public function getAllCategories()
    {
        $arr = $this -> db -> select('SELECT * FROM category');
        return json_encode($arr);
    }
    
     public function getSchema( $name)
    {
        return json_encode($this->db->select("SHOW COLUMNS FROM c_".$name));
    }
}